package com.wang.project.utils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.util.HashMap;
import java.util.Map;

public class ParamHandleUtil {
    public static Map<String, Object> handleParam(String param) {
        Gson gson = new Gson();
        Map<String, Object> map = new HashMap<>();
        try {
            // 将 JSON 解析为 Map<String, Object>
            map = gson.fromJson(param, new TypeToken<Map<String, String>>() {
            }.getType());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return map;

/**
 * {
 *     "creator": 5042224,
 *     "modifier": 5042224,
 *     "customerLevel": "二级",
 *     "number": "110007",
 *     "purchaserId": 3673883190399857,
 *     "name": "创建007",
 *     "salesman": "业务员7号"
 * }
 */
    }
}
